// import { createRouter, createWebHashHistory, type RouteRecordRaw } from "vue-router";
// import Tool from "../views/Tool.vue"

// // 路由表
// //
// const routes:RouteRecordRaw[]=[
//     {
//         path:'/',
//         redirect:"/tool"
//     },
//     {
//         name:'login',
//         path:"/login",
//         component:()=>import("../views/LoginPage.vue")
//     },
//     {
//         name:'tool',
//         path:"/tool",
//         component:Tool,
//         children:[
//             {
//                 name:"index",
//                 path:"index",
//                 component:()=>import("../views/tool/Index.vue")
//             },
//              {
//                 name:"cate",
//                 path:"cate",
//                 component:()=>import("../views/tool/Cate.vue")
//             },
//              {
//                 name:"car",
//                 path:"car",
//                 component:()=>import("../views/tool/Car.vue")
//             },
//              {
//                 name:"my",
//                 path:"my",
//                 component:()=>import("../views/tool/My.vue")
//             },
//         ]
//     },
// ]

// // 创建路由对象
// const router = createRouter({
//     history:createWebHashHistory(),
//     routes
// })

// export default router



import { createRouter, createWebHistory } from 'vue-router'
import Tool from '../views/Tool.vue'
import Login from '../views/Login.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/tool/index'
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/tool',
      name: 'Tool',
      component: Tool,
      children: [
        {
          path: 'index',
          component: () => import('../views/Index.vue')
        },
        {
          path: 'cate',
          component: () => import('../views/Cate.vue')
        },
        {
          path: 'car',
          component: () => import('../views/Car.vue')
        },
        {
          path: 'my',
          component: () => import('../views/My.vue')
        }
      ]
    }
  ]
})

export default router